from Cython.Build import cythonize
from setuptools import setup

# Cython 编译参数
COMPILER_DIRECTIVES = {'language_level': 3, 'always_allow_keywords': True, 'annotation_typing': False}


class Operator:
    def compile(self):
        names = ['utils/*.py']

        # 执行
        setup(
            ext_modules=cythonize(names, quiet=True, compiler_directives=COMPILER_DIRECTIVES),
            script_args=['build_ext', '--inplace'],
        )

    def execute(self):
        self.compile()


# 默认只能处理一个文件夹
Operator().execute()
